<template>
  <div>
    <Table border :columns="columns" :data="questionList" ></Table>
  </div>
</template>

<script>
import { globalUrl } from '@/api/doMain'

export default {
  name: 'Question',
  created () {
    this.queryList()
  },
  data () {
    return {
      columns: [
        {
          title: 'Id',
          key: 'id',
          type: 'selection',
          width: 55
        },
        {
          title: '标题',
          key: 'title'
        },
        {
          title: '子标题',
          key: 'subTitle'
        },
        {
          title: '问题内容',
          key: 'content',
          tooltip: true
        },
        {
          title: '类目',
          key: 'categoryId'
        },
        {
          title: '创建时间',
          key: 'createTime'
        }
      ],
      questionList: []
    }
  },
  methods: {
    queryList () {
      const that = this
      this.http.post(globalUrl + '/question/queryList', { token: window.sessionStorage.getItem('token') }).then(function (response) {
        that.questionList = response.data.data
      })
    }
  }
}
</script>

<style scoped>

</style>
